import cv2 as cv

img = cv.imread('../resources/miku.jpg')

h, w, c = img.shape
for y in range(h):
    for x in range(w):
        b, g, r = img[y, x]
        img[y, x] = (b, g, 255-b)

# cv.imwrite('../resources/miku_blue.jpg', img)
cv.imshow('img', img)
cv.waitKey(0)
cv.destroyAllWindows()

# 注意图片大小与像素的通道一致